#pragma once

#include "json/EZReader.h"
#include "json/EZWriter.h"
#include <iostream>
#include <assert.h>


inline void json_test()
{
    EZValue js1;
    std::string j1 = "{'key1':'hello','key2':123,\"key3\":[1,[2,3,5,6],{},'22',33,{'akey':999},{'bkey':888,'ck':[{'key1':'hello'}]}]}";
    assert(EZReader().parse(j1, js1));
    std::cout << EZWriter().write(js1) << std::endl;
	std::cout << EZStyledWriter().write(js1) << std::endl;

    EZValue js2;
    std::string j2 = "{'k':1,'k':[]}";
    assert(!EZReader().parse(j2, js2));

    EZValue js3;
    js3["key1"] = 100;
    js3["key2"] = "val2";
    js3["key3"][0] = 200;
    js3["key3"][1] = "val3";
    std::cout << EZWriter().write(js3) << std::endl;

}
